package com.yuantu.judiciary.dao;

import com.yuantu.judiciary.model.domain.QueryResultDO;
import com.yuantu.judiciary.model.enums.QueryType;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * 查询结果数据库操作
 *
 * @author syw
 * @since 2023-07-12
 **/
public interface IQueryResultDao extends JpaRepository<QueryResultDO, Long> {

    QueryResultDO findFirstByEntityIdAndTypeAndCreatorIdAndDeletedFalse(Long entityId, QueryType type, Long creatorId);

    QueryResultDO findFirstByEntityIdAndTypeAndDeletedFalse(Long entityId, QueryType type);

    List<QueryResultDO> findByEntityIdAndTypeAndDeletedFalse(Long entityId, QueryType type);

}
